home *** CD-ROM | disk | FTP | other *** search
- Path: nic.wat.hookup.net!news
- From: xenon@the-fix.sos.on.ca
- Newsgroups: comp.lang.c
- Subject: Streams
- Date: Mon, 22 Jan 1996 18:27:41 GMT
- Organization: HookUp Communication Corporation, Waterloo, Ontario, CANADA
- Message-ID: <4e0lp3$lkf@nic.wat.hookup.net>
- NNTP-Posting-Host: slip10.sos.on.ca
- X-Newsreader: Forte Free Agent 1.0.82
-
- HI, im having some trouble getting my program to write to streams...
- ex:
-
-
- #include <stdio.h>
-
- int main(void)
- {
- FILE *stream;
- int i = 100;
- char c = 'C';
- float f = 1.234;
-
- /* open a file for update */
- stream = fopen("DUMMY.FIL", "w+");
-
- /* write some data to the file */
- fprintf(stream, "%d %c %f", i, c, f);
-
- /* close the file */
- fclose(stream);
- return 0;
- }
-
-
- This example taken out of the Borland Help library should work fine.
- Yet, nothing is written to the file "dummy.fil". although the file is
- created. I have tried running my comiler from Dos and Win95 to no
- avail. My stream problem is no just centered around the disk file
- streams, but also stdout, and stderr. Strangely though, my read() and
- write() functions work just fine.
- thankx
- xenon@the-fix.sos.on.ca
-
-
-